<#assign path="${springMacroRequestContext.getContextPath()}">
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>国家电网缴费系统</title>
    <meta name="keywords"   />
    <meta name="description"  />
    <meta name="author" content="DeathGhost" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <link rel="icon" href="${path}/static/images/icon/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="${path}/static/css/style.css" />
    <script src="${path}/static/javascript/jquery.js"></script>
    <script src="${path}/static/javascript/plug-ins/customScrollbar.min.js"></script>
    <script src="${path}/static/javascript/plug-ins/echarts.min.js"></script>
    <script src="${path}/static/javascript/plug-ins/layerUi/layer.js"></script>
    <script src="${path}/static/editor/ueditor.config.js"></script>
    <script src="${path}/static/editor/ueditor.all.js"></script>
    <script src="${path}/static/javascript/plug-ins/pagination.js"></script>
    <script src="${path}/static/javascript/public.js"></script>
    <script src="${path}/static/javascript/menu.js"></script>
</head>
<style type="text/css">
    .asd{
        padding: 12px;
    }
    .inputcs {
        width: 300px
    }
</style>
<script type="text/javascript">

    function quit(){
        if(confirm("你确定要退出登陆吗？")){
            window.location.href = "${path}/User/quit";
        }
    }


    function checkpass(){
        var oldpaH = $("#oldpa").val();
        var oldpaS = $("#oldpassword").val();
        var password =  $("#password").val();
        var password2 = $("#password2").val();
        if(!oldpaS){
            layer.alert("请输入旧密码！！")
            return false;
        }

        if(!password){
            layer.alert("请输入新密码！！")
            return false;
        }
        if(!password2){
            layer.alert("请输入确认密码！！")
            return false;
        }

        if(oldpaH != oldpaS){
            layer.alert("旧密码输入错误，请重新输入！")
            return false;
        }

        if(password != password2){
            layer.alert("两次输入密码不一致，请重新输入！")
            return false;
        }else{
            return true;
        }

    }
</script>
<body>
<div class="main-wrap">
    <input type="hidden" id="power222" name="power" value="${Session["power"]}" >
    <input type="hidden" id="oldpa" value="${Session["user"].password}">
    <#include "/leftmenu.ftl"/>
    <div class="content-wrap">
        <header class="top-hd">
            <div class="hd-lt">
                <a class="icon-reorder"></a>
            </div>
            <div class="hd-rt">
                <ul>
                    <li>
                        <a><i class="icon-user"></i>系统时间:<em>${Session["time"]}</em></a>
                    </li>
                    <li>
                        <a><i class="icon-user"></i>${Session["roleName"]}:<em>${Session["user"].name}</em></a>
                    </li>
                    <li>
                        <a onclick="quit();" ><i class="icon-signout"></i>安全退出</a>
                    </li>
                </ul>
            </div>
        </header>
        <main class="main-cont content mCustomScrollbar">
            <!--开始::内容-->
            <div class="page-wrap">
                <section class="page-hd">
                    <header>
                        <h2 class="title"><i class="icon-home"></i>修改密码</h2>
                    </header>
                    <hr>
                </section>
                <blockquote class="blockquote mb-20" style="margin-left: 20px">
                    <form method="post" action="${path}/User/updatePa">
                        <input type="hidden" name="userID" value="${Session["user"].id}">
                        <div class="form-group-col-2">
                            <div class="form-label">旧密码：</div>
                            <div class="form-cont">
                                <input type="password" placeholder="请输入旧密码" id="oldpassword" class="form-control form-boxed inputcs" style="width:250px;">
                            </div>
                        </div>
                        <div class="form-group-col-2">
                            <div class="form-label">新密码：</div>
                            <div class="form-cont">
                                <input type="password" placeholder="请输入新密码" id="password" name="password" class="form-control form-boxed inputcs" style="width:250px;">
                            </div>
                        </div>
                        <div class="form-group-col-2">
                            <div class="form-label">确认密码：</div>
                            <div class="form-cont">
                                <input type="password" placeholder="确认密码" id="password2" name="Dfdj" class="form-control form-boxed inputcs" style="width:250px;">
                            </div>
                        </div>
                        <div class="form-group-col-2">
                            <div class="form-label"></div>
                            <div class="form-cont">
                                <input type="submit" class="btn btn-primary" onclick="return checkpass()" value="提交" />
                            </div>
                        </div>
                    </form>
                </blockquote>
            </div>
        </main>
        <footer class="btm-ft">
            <p class="clear">
                <span class="fl">©Copyright 2019</span>
                <span class="fr text-info">
					<em class="uppercase">
						<i class="icon-user"></i>
						management system
					</em>
				</span>
            </p>
        </footer>
    </div>
</div>
</body>
</html>
